package com;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ControllerServlet extends HttpServlet {



public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {
	String username = request.getParameter("username");
	String password = request.getParameter("password");
	UserBean user = new UserBean();
	user.setUsername(username);
	user.setPassword(password);
	UserCheckBean userCheckBean = new UserCheckBean();
	boolean flag = userCheckBean.checkUser(user);
	if (flag) {
		request.getRequestDispatcher("model/welcome.jsp").forward(request,response);
	} else {
		request.getRequestDispatcher("model/error.jsp").forward(request,response);
	}
}
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

	}

	

}
